package com.admin.qanda;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import com.intro.MemoLogic;
import com.util.HangulConversion;
import com.util.HashMapBinder;
import com.vo.MemberVO;

public class MemberController extends MultiActionController {
	Logger logger = Logger.getLogger(MemberController.class);
	private MemberLogic memberLogic = null;
	public void setMemberLogic(MemberLogic memberLogic) {
		this.memberLogic = memberLogic;
	}
public void memberLogin(HttpServletRequest req, HttpServletResponse res) throws IOException
	{
	logger.info("===[[MemberController MemberLogin call]]===");
	MemberVO mVO = new MemberVO();
	mVO.setId(HangulConversion.toKor(req.getParameter("id")));
	mVO.setPasswd(HangulConversion.toKor(req.getParameter("passwd")));
	mVO = memberLogic.memberLogin(mVO);
	if(mVO!=null){
	res.sendRedirect("./getBoardList.hy");
	}
	else{
	res.sendRedirect("./login.hy");
		}
	}
}